package com.yupi.apiinterface.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yupi.apiinterface.domain.User;
import com.yupi.apiinterface.service.UserService;
import com.yupi.apiinterface.utils.SingUtils;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/name")
public class SignController {
    @Resource
    private UserService userService;

    @GetMapping("/get")
    public String GetNameByGet(String name,HttpServletRequest request){
        final String header = request.getHeader("ljh");
        return "Get 你的名字是:"+name;
    }
//    http://localhost:8123/api/name/get?name=ljh
    @PostMapping("/name")
    public String PostNameByPost(@RequestParam String name){
        return "Post 你的名字是"+name;
    }
    @PostMapping("/restful")
    public String PostNameByPostRestful(@RequestBody User name, HttpServletRequest request){
        return "PostRestful 你的名字是" + name;
    }
    //http://localhost:8123/api/name/restful
}
